home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
FishMarket 1.0
/
FishMarket v1.0.iso
/
fishies
/
126-150
/
disk_129
/
patch
/
ver2.0
/
request.c
< prev
next >
Wrap
C/C++ Source or Header
|
1992-05-06
|
2KB
|
87 lines
/* put up a simple requester */
#include <exec/types.h>
#include <intuition/intuitionbase.h>
#ifndef MANX
#include <proto/exec.h>
#include <proto/intuition.h>
#endif
#include <stdio.h>
#include <string.h>
#ifndef MANX
#include <stdlib.h>
#endif
extern struct Library *OpenLibrary();
extern struct IntuitionBase *IntuitionBase;
extern struct GfxBase *GfxBase;
/* AutoRequest data structures */
#define REDP 3
#define BLKP 2
#define WHTP 1
#define BLUP 0
static struct IntuiText questionText = {
REDP, WHTP,
JAM2,
5, /* LeftEdge */
5, /* TopEdge */
NULL, /* Default font */
NULL, /* Text (to be filled in) */
NULL /* No pointer to next text */
};
/** YES TEXT **/
static struct IntuiText yesText = {
BLUP, WHTP,
JAM2,
7, /* LeftEdge */
3, /* TopEdge */
NULL, /* Default font */
(UBYTE *) "Yes", /* Text */
NULL /* No pointer to next text */
};
/** NO TEXT **/
static struct IntuiText noText = {
REDP, WHTP,
JAM2,
7, /* LeftEdge */
3, /* TopEdge */
NULL, /* Default font */
(UBYTE *) "No", /* Text */
NULL
};
initMachSpecific()
{
if ((GfxBase = (struct GfxBase *)
OpenLibrary("graphics.library", 0)) == 0) {
fprintf(stderr,"Unable to open graphics.library\n");
my_exit(20);
}
if ((IntuitionBase = (struct IntuitionBase *)
OpenLibrary("intuition.library", 0)) == 0) {
fprintf(stderr,"Unable to open intuition.library\n");
my_exit(21);
}
}
cleanMachSpecific()
{
if (IntuitionBase)
CloseLibrary((struct Library *) IntuitionBase);
if (GfxBase)
CloseLibrary((struct Library *) GfxBase);
}
simpleRequest(question)
char *question;
{
questionText.IText = (UBYTE *) question;
return(AutoRequest(0, &questionText, &yesText, &noText, 0, 0,
max(strlen(question)*8 + 34, 150), 60));
}